package mt2176;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	// 计算next数组（前缀表）
	// 该方法另一个常用名称为prefix_function
	static int[] get_next(String s) {
		int n = s.length();
		int[] pi = new int[n];
		for (int i = 1; i < n; i++) {
			int j = pi[i - 1];
			while (j > 0 && s.charAt(i) != s.charAt(j)) {
				j = pi[j - 1];
			}
			if (s.charAt(i) == s.charAt(j)) {
				j++;
			}
			pi[i] = j;
		}
		return pi;
	}

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();
        
        String[] lineArr = br.readLine().split(" ");
        int n = Integer.parseInt(lineArr[0]);
        int k = Integer.parseInt(lineArr[1]);
        
        String str = br.readLine();
        
        int[] next = get_next(str);
        
        int temp = next[str.length()-1];
        String lps = str.substring(0,temp);
        
        //System.out.println(lps);
        
        String str1 = str.substring(0,str.length()-temp);
        
        //System.out.println(str1);
        
        //原字符串去掉最长后缀重复k次
        for(int i=0;i<k;i++)
        	sb.append(str1);
        
        //System.out.println(sb.toString());
        
        //补上最长后缀
        sb.append(lps);
        
        //输出结果
        System.out.println(sb.toString());
	}

}
